
package login.modelo;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class ReservaDAO {
     Connection c;
    private final Connection connection;
    public ReservaDAO(Connection connection){
        this.connection=connection;
    }
 
    public boolean consulta(String consulta){
        try{
        PreparedStatement pst=connection.prepareStatement(consulta);
        ResultSet rs=pst.executeQuery();
        }catch(SQLException e){
            System.out.println("e: "+e);
            return false;
        }
        return true;
    }
    
        public ResultSet consulta2(String consulta){
        ResultSet rs=null;
        try{
        PreparedStatement pst=c.prepareStatement(consulta);
        rs=pst.executeQuery();
        }catch(SQLException e){
            System.out.println("e: "+e);
        }
        return rs;
    }
}
